package com.itheima.a01mymap;

import java.util.*;

public class A02_MapDemo2 {
    public static void main(String[] args) {
        Map<String,String> map=new HashMap<>();

        map.put("尹志平","小龙女");
        map.put("郭靖","穆念慈");
        map.put("欧阳克","黄蓉");

        //获取所有的键
        Set<String> keys=map.keySet();

        Iterator<String> it=keys.iterator();
        while(it.hasNext()){
            String key= it.next();
            //System.out.println(key);
            String value=map.get(key);
            System.out.println(key+" "+value);
        }
    }
}
